package com.wlc.springdemo.controller;

import com.wlc.springdemo.service.UserInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 王立朝
 * @date 2022/11/23
 * @description:
 */
@RestController
@Slf4j
public class BookController {

    // 使用账户去书店购买书籍
    @Resource
    private UserInfoService userInfoService;
    /**
     * 购买图书
     * @return
     */
    @GetMapping("/buybook")
    public String buyBook(){
        log.info("开始购买图书");
        userInfoService.buyBook();
        return "购买成功！";
    }
}
